<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>运行信息</title>
    <script type="text/javascript" src="../../assets/easyui/easyui1.7.0/jquery.min.js"></script>
    <script type="text/javascript" src="../../assets/easyui/easyui1.7.0/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../assets/easyui/easyui1.7.0/easyui.comm.valid.js"></script>
    <script type="text/javascript" src="../../assets/easyui/easyui1.7.0/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../../assets/easyui/easyui.grid.hide.js"></script>
    <script type="text/javascript" src="../../js/easyui/Common.js"></script>
    <script type="text/javascript" src="../../js/easyui/comm.dict.js"></script>
    <script type="text/javascript" src="../../js/easyui/DateUtils.js"></script>
    <script type="text/javascript" src="common.task.js"></script>
    <script type="text/javascript" src="runInfo.js"></script>
    <link rel="stylesheet" type="text/css" href="../../assets/easyui/easyui1.7.0/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../assets/easyui/easyui1.7.0/themes/icon.css">

    <style type="text/css">
        #fm {
            margin: 0;
            padding: 10px 20px;
        }

        .ftitle {
            font-size: 14px;
            font-weight: bold;
            padding: 5px 0;
            margin-bottom: 10px;
            border-bottom: 1px solid #ccc;
        }

        .fitem {
            margin-bottom: 5px;
        }

        .fitem label {
            display: inline-block;
            width: 120px;
        }

        .input_query {
            width: 80px;
        }

        input, textarea {
            width: 160px;
            border: 1px solid #ccc;
            padding: 2px;
        }
    </style>
</head>

<body>

<div class="easyui-layout" data-options="fit:true">
    <!-- 查询条件  -->
    <div data-options="region:'north', title:'运行信息-统计信息会定时自动同步到数据库，然后并清0'"
         style="height: 80px; padding: 5px 10px;display:none;">
        <form id="search-form">
            <table class="search-table">
                <tr>
                    <td>
                        key:
                        <input type="text" id="query_key" name="key" class="easyui-validatebox">
                    </td>
                    <td>
                        时间类型:
                        <input id="query_countType" name="countType" class="easyui-combobox" data-options="valueField:'code',textField:'name',panelHeight:'auto'">
                    </td>
                    <td>
                        节点:
                        <input id="query_taskHostCode" name="taskHostCode" class="easyui-combobox" data-options="valueField:'code',textField:'remark',panelHeight:'auto'">
                    </td>
                    <td>
                        <a class="easyui-linkbutton"
                           data-options="iconCls:'icon-search'" id="search-btn" onclick="javascript:doSearch()">查询</a>
                        <a class="easyui-linkbutton"
                           data-options="iconCls:'icon-reload'" id="reset-btn">重置</a>
                    </td>

                </tr>
            </table>
        </form>
    </div>

    <!-- 查询结果 center -->
    <div data-options="region:'center', title:'查询结果'">
        <div id="toolbar" style="display:none;">
            <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="onEdit()">修改</a>
        </div>
        <table id="dg" class="easyui-datagrid"
               data-options="onDblClickRow:onDblClick, onClickRow:onClick, onLoadError:loadError, loader:dataLoader, onLoadSuccess:function(r){$('.datagrid-btable').find('div.datagrid-cell').css('text-align','left');}"
               toolbar="#toolbar" pagination="true" sortName="createTime" sortOrder="desc"
               rownumbers="true" fitColumns="true" singleSelect="true" style="display:none;">
            <thead>
            <tr>
                <th align="center" field="key" width="150" sortable="true" rowspan="2">key</th>
                <th align="center" field="countType" width="50" sortable="true" rowspan="2">时间类型</th>
                <th align="center" field="timeValue" width="50" sortable="true" rowspan="2">timeValue</th>
                <th colspan="7">taskCompute</th>
                <th align="center" field="runCounter" width="50" sortable="true" rowspan="2">执行次数</th>
                <th colspan="4">首次</th>
                <th colspan="4">最新</th>
                <th colspan="4">最大</th>
                <th colspan="5"><font color="red">错误</font></th>
            </tr>
            <tr>
                <th align="center" field="taskCompute.showProcessing" width="100" hidden="true" formatter="taskComputeShowProcessing" >showProcessing</th>
                <th align="center" field="taskCompute.dataIdArg" width="100" hidden="true" sortable="true" formatter="taskComputeDataIdArg">dataIdArg</th>
                <th align="center" field="taskCompute.userIdArg" width="100" hidden="true" sortable="true" formatter="taskComputeUserIdArg">userIdArg</th>
                <th align="center" field="taskCompute.category" width="100" hidden="true" sortable="true" formatter="taskComputeCategory">category</th>
                <th align="center" field="taskCompute.pkg" width="100" hidden="true" sortable="true"  data-options="formatter: function(value,row,index){
                                return row.taskCompute.pkg;
                            }">pkg</th>
                <th align="center" field="taskCompute.type" width="50" sortable="true" data-options="formatter: function(value,row,index){
                                return row.taskCompute.type;
                            }">type</th>
                <th align="center" field="sourceCounterMap" width="50" sortable="false" data-options="formatter: function(value,row,index){
                                return JSON.stringify(row.sourceCounterMap).replaceAll(',',',\n');
                            }">sourceCounterMap</th>
                <th align="center" field="first.ts" width="50" sortable="true" hidden="true" formatter="firstTs">
                    首次时间
                </th>
                <th align="center" field="first.runTime" width="50" sortable="true"  hidden="true" formatter="firstRunTime">
                    首次时长
                </th>
                <th align="center" field="first.uid" width="50" sortable="true" hidden="true" formatter="firstUid">
                    首次UserId
                </th> <th align="center" field="first.dataId" width="50" sortable="true" hidden="true" formatter="firstDataId">
                首次dataId
            </th>
                <th align="center" field="newly.ts" width="50" sortable="true" formatter="newlyTs">
                    最新时间
                </th>
                <th align="center" field="newly.runTime" width="50" sortable="true" formatter="newlyRunTime">最新时长</th>
                <th align="center" field="newly.uid" width="50" sortable="true" hidden="true" formatter="newlyUid">最新userId</th>
                <th align="center" field="newly.dataId" width="50" sortable="true" hidden="true" formatter="newlyDataId">最新dataId</th>
                <th align="center" field="max.ts" width="50" sortable="true"
                    formatter="maxTs">最大时长的时间
                </th>
                <th align="center" field="max.runTime" width="50" sortable="true" formatter="maxRunTime">最大时长</th>
                <th align="center" field="max.uid" width="50" hidden="true" formatter="maxUid">最大时长userId</th>
                <th align="center" field="max.dataId" width="50" hidden="true" formatter="maxDataId">最大时长dataId</th>

                <th align="center" field="error.ts" width="50" hidden="true" sortable="true"
                    formatter="errorTs">错误时间
                </th>
                <th align="center" field="error.uid" width="50" hidden="true" formatter="errorUid">错误userId</th>
                <th align="center" field="error.dataId" width="50" formatter="errorDataId">错误dataId</th>
                <th align="center" field="error.remark" width="100" formatter="errorRemark">错误信息</th>
                <th align="center" field="errorCounter" width="50" sortable="true">错误次数</th>
            </tr>
            </thead>
        </table>
    </div>
</div>

<div id="dlg" class="easyui-dialog" style="width:500px;height:500px;padding:5px 10px;display:none;"
     closed="true" buttons="#dlg-buttons">
    <form id="fm" method="post" novalidate>
        <div class="fitem">
            <label>key:</label>
            <input name="key" class="easyui-validatebox" required="true">
        </div>
        <div class="fitem">
            <label>时间类型:</label>
            <input name="countType" class="easyui-validatebox" required="true">
        </div>
        <div class="fitem">
            <label>timeValue:</label>
            <input name="timeValue" class="easyui-validatebox" required="true">
        </div>
        <div class="fitem">
            <label>执行次数:</label>
            <input name="runCounter" class="easyui-validatebox">
        </div>
        <div class="fitem">
            <label>最近执行时长:</label>
            <input name="runTime" class="easyui-validatebox">
        </div>

        <fieldset>
            最新
            <div class="fitem">
                <label>时长:</label>
                <input id="fm-newly-runTime" name="newly.runTime" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>时间:</label>
                <input id="fm-newly-ts" name="newly.ts" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>userId:</label>
                <input id="fm-newly-uid" name="newly.uid" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>dataId:</label>
                <input id="fm-newly-dataId" name="newly.dataId" class="easyui-validatebox">
            </div>
        </fieldset>

        <fieldset>
            最大执行时间
            <div class="fitem">
                <label>时长:</label>
                <input id="fm-max-runTime" name="max.runTime" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>时间:</label>
                <input id="fm-max-ts" name="max.ts" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>userId:</label>
                <input id="fm-max-uid" name="max.uid" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>dataId:</label>
                <input id="fm-max-dataId" name="max.dataId" class="easyui-validatebox">
            </div>
        </fieldset>


        <div class="fitem">
            <label>来源次数统计:</label>
            <textarea name="sourceCounterJson" style="height:60px;width:220px"></textarea>
        </div>
        <div class="fitem">
            <label>正在处理的数据:</label>
            <textarea name="processingDataJson" style="height:60px;width:220px"></textarea>
        </div>
        <fieldset>
            最新异常错误信息
            <div class="fitem">
                <label>错误时间:</label>
                <input id="fm-error-ts"  name="error.ts" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>错误userId:</label>
                <input id="fm-error-uid"  name="error.uid" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>错误dataId:</label>
                <input id="fm-error-dataId" name="error.dataId" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>错误次数:</label>
                <input name="errorCounter" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>错识信息:</label>
                <textarea id="fm-error-remark"  name="error.remark" style="height:60px;width:220px"></textarea>
            </div>
        </fieldset>

        <fieldset>
            配置信息
            <div class="fitem">
                <label>分类:</label>
                <input name="taskCompute.category" id="fm-category" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>dataId参数序号:</label>
                <input name="taskCompute.dataIdArgCount" id="fm-dataIdArgCount" class="easyui-validatebox">
            </div>
            <div class="fitem">
                <label>显示正在执行数据:</label>
                <input name="taskCompute.showProcessing" id="fm-showProcessing" class="easyui-validatebox">
            </div>
        </fieldset>

    </form>
    <div id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
           onclick="javascript:$('#dlg').dialog('close')">Cancel</a>
    </div>
</div>

<script type="text/javascript">

</script>
</body>
</html>